package animations;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;

import ui.GameElementIfc;

public class NetGround implements GameElementIfc {
	protected volatile int margin;

	protected volatile int size;
	protected volatile int cells;
	protected volatile Color color;
	private Dimension backGroundSize;

	public NetGround(Dimension backGroundSize) {
		this.margin = 10;
		this.size = 20;
		this.cells = 25;
		this.color = Color.GRAY;
		this.backGroundSize = backGroundSize;
	}

	@Override
	public void drawBody(Graphics2D g) {
		g.setColor(Color.WHITE);
		g.fillRect(0, 0, backGroundSize.width, backGroundSize.height); // Set background color

		int s = size * cells;
		int len = s + margin;

		g.setColor(color);
		for(int i = 0; i <= cells; i++) {
			s = i * size;

			g.drawLine(margin, margin + s, len, margin + s);// horizontal line
			g.drawLine(margin + s, margin, margin + s, len);// vertical line
		}
	}

	@Override
	public void doMove(double deltaT) {
		// TODO Auto-generated method stub

	}
}
